﻿@{
    Layout = "~/Views/Shared/_LayoutProfile.cshtml";
    var list = ViewBag.CategoryList as SelectList;
    var check = ViewBag.Selected as List<string>;
}

<div class="row-fluid">
    <div class="span12">
        <div class="box box-bordered">
            <div class="box-title">
                <h3><i class="icon-th-list"></i>Account Setting</h3>
            </div>
            <div class="box-content nopadding">
                @using (Html.BeginForm("AccountSetting", "Profile", FormMethod.Post, new { @class = "form-horizontal form-striped"}))
                {

                    object index = 0;

                    <div class="control-group">
                        <label for="textfield" class="control-label">Feed Categories</label>
                        <div class="controls">
                            @*@Html.ListBox("category", list, new { @class = "input-xlarge", @placeholder = "Text input" })*@
                        
                            <select name="category" multiple="multiple" class="input-xlarge" placeholder="Text input">
                     @foreach (var item in list)
                     {
                         var selected = "";
                      
                      if (check.Contains(item.Value))
                         {
                             selected = "selected";
                         }
  <option value="@item.Value" @selected>@item.Text</option>
                     }
                                           
                            </select>
                        </div>
                    </div>
             

                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">Save changes</button>
                        <button type="button" class="btn">Cancel</button>
                    </div>
                }
            </div>
        </div>
    </div>
</div>
